<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('区域管理')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<style>
    .bootstrap-tree-table .treetable-tbody td {
        white-space: normal !important;
    }

    .select-table {
        overflow: scroll;
        height: 89% !important;
        padding: 10px !important;

    }

    select {
        padding-top: 3px !important;
    }

    .select-list {
        margin-top: 5px !important;
    }

    .treetable-expander {
        width: auto !important;
        height: auto !important;
    }

    .bootstrap-tree-table .treetable-bars .tool-right {
        float: left !important;
        left: 10px;
    }

    .table-striped .table > thead:first-child > tr:first-child > th {
        font-weight: normal;
        font-size: 13px;
        border: 1px solid #cccccc !important;
    }

    .bootstrap-tree-table .treetable-tbody td {
        border: 1px solid #cccccc !important;
        border-top: 0px solid #cccccc !important;
    }

    .select-list li p {
        width: 20px !important;
    }

</style>
<body class="gray-bg">

<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" id="add"
                   onclick="$.operate.add()">
                    <i class="fa fa-plus"></i> 更新
                </a>

            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">

    /* 获取服务端返回变量 */
    var progressId = [[${progressId}]];
    var planEndTime = [[${planEndTime}]];

    var programName = [[${programName}]];
    var batch = [[${batch}]];
    var node = [[${node}]];
    var programId = [[${programId}]];
    var buildingNumber = [[${buildingNumber}]];


    var param = "?";
    if(programName != null){
        param = param.concat("&programName=" + programName);
    }
    if(batch != null){
        param = param.concat("&batch=" + batch);
    }
    if(node != null){
        param = param.concat("&node=" + node);
    }
    if(programId != null){
        param = param.concat("&programId=" + programId);
    }
    if(buildingNumber != null){
        param = param.concat("&buildingNumber=" + buildingNumber);
    }

    /* 服务端模块url */
    var prefix = ctx + "progressplan";

    /* 初始化方法 */
    $(function () {
        var panehHidden = false;
        if ($(this).width() < 769) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 300});

        querylist();
    });

    /* 获取列表 */
    function querylist(){
        var options = {
            url: prefix + "/detailList?progressId="+progressId,
            createUrl: prefix + "/detailAddView?progressId="+progressId+"&planEndTime="+planEndTime,
            modalName: "动态详情",
            columns: [
                {
                    checkbox: true,
                    valign: "middle",
                    align: 'center'
                },
                {
                    title: "序号",
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    },
                    width:"5%",
                },
                {
                    field: 'node',
                    align: 'center',
                    title: '节点名称'
                },
                {
                    field: 'planEndTime',
                    align: 'center',
                    title: '计划完成时间'
                },
                {
                    field: 'progressDetail',
                    align: 'center',
                    title: '进度情况'
                },
                {
                    field: 'status',
                    align: 'center',
                    title: '完成情况'
                }
                ]
        };
        $.table.init(options);
    }

    function submitHandler() {
        $.modal.close();
        parent.refresh();
    }
</script>
</body>
</html>